<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <title>设置密码 - 期金管家</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
</head>
<body>
<!--HEADER-->
{include file="Public/header"/}
<!--HEADER-->

<div class="container setPassword">
    <div class="row">
    {include file="Public/readme"/}

        <div class="col-md-9">
            <ul class="nav nav-tabs mb-4" role="tablist">
                <li class="nav-item">
                    <a class="nav-link bg-dark text-white active" href="#home" role="tab" data-toggle="tab">修改登录密码</a>
                </li>
            </ul>
            <div class="tab-content row">
                <div class="col-md-4 text-center d-none d-sm-block">
                    <img src="/static/home/images/imgHead.jpg" />
                </div>
                <form id="setpwForms" method="post" class="form-horizontal col-md-8" action="/home/Editlogpwd/editPwd" novalidate="novalidate">
                    <div class="passwordSet">
                        <div class="form-group row">
                            <label class="col-md-3 sm-text-right control-label" for="setpwUserName"><b class="text-danger">*</b>修改登录密码：</label>
                            <div class="col-md-9 has-error has-feedback">
                                <input type="text" class="form-control" id="setpwUserNames" name=""  placeholder="已经设置" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true" disabled>
                                <span class="glyphicon glyphicon-remove form-control-feedback"></span>
                                <label id="setpwUserName-errors" class="error" for="setpwUserName"></label>
                            </div>
                        </div>
                        <div class="form-group row">
                            <div class="col">
                                <button type="submit" class="btn btn-success btn-block" name="signup1s" id="signup1s" value="重新设置密码">修改登录密码</button>
                            </div>
                        </div>
                    </div>
                    <div class="passwordReset">
                        <div class="form-group row">
                            <label class="col-md-3 sm-text-right control-label" for="setpwUserName"><b class="text-danger">*</b>&nbsp;用户名：</label>
                            <div class="col-md-9 has-error has-feedback">
                                <input type="text" class="form-control" id="setpwUserName" name="mobile" placeholder="{:substr(Session('phonenumber'),0,3).'****'.substr(Session('phonenumber'),-4)}" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true" disabled="">
                                <span class="glyphicon glyphicon-remove form-control-feedback"></span>
                                <label id="setpwUserName-error" class="error" for="setpwUserName"></label>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-md-3 sm-text-right control-label" for="setpwUserName"><b class="text-danger">*</b>&nbsp;登录密码：</label>
                            <div class="col-md-9 has-error has-feedback">
                                <input type="password" class="form-control" id="--setpwUserName" name="logpwd"  placeholder="请输入登录密码" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true">
                                <span class="glyphicon glyphicon-remove form-control-feedback"></span>
                                <label id="setpwUserName-error" class="error" for="setpwUserName"></label>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-3 control-label" for="setpwUserPassword"><b class="text-danger">*</b>&nbsp;新密码：</label>
                            <div class="col-md-9 has-error has-feedback">
                                <input type="password" class="form-control" id="setpwUserPassword" name="pwd" placeholder="请输入密码" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true">
                                <span class="glyphicon glyphicon-remove form-control-feedback" id="pwd"></span>
                                <label id="setpwUserPassword-error" class="error" for="setpwUserPassword"></label>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-md-3 control-label" for="setpwUserConfirmPassword"><b class="text-danger">*</b>&nbsp;确认密码：</label>
                            <div class="col-md-9 has-error has-feedback">
                                <input type="password" class="form-control" id="setpwUserConfirmPassword" name="pwds" placeholder="请再次输入密码" aria-required="true" aria-describedby="firstname1-error" aria-invalid="true">
                                <span class="glyphicon glyphicon-remove form-control-feedback" id="pwds"></span>
                                <label id="setpwUserConfirmPassword-error" class="error" for="setpwUserConfirmPassword"></label>
                            </div>
                        </div>
                        <input type="hidden" name="codes" value="{:session('codes')}">
                        <div class="form-group row">
                            <div class="col">
                                <button type="submit" class="btn btn-success btn-block" name="signup1" value="重新设置密码">设置登录密码</button>
                            </div>
                        </div>
                        <p style="padding:10px 5px;"><b class="fontRed">*注：</b>尊敬的客户你好，为保护客户的隐私，公司决定采用身份证号码注册，不再保留客户的手机号码，所以客户忘记密码将无法自己重置，需要联系公司客服重置密码。忘记密码客户请拨打400-071-0176联系事宜。</p>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<div class=""><br /><br /><br /><br /><br /></div>
<!--footer-->
{include file="Public/footer"/}
<!--footer-->
</body>
</html>
<script> $("#collapseOne").find(".list-group").find("li").eq(8).addClass("active");</script>
<script>

    flag=false;flags = false;flpwd=false;flpwds=false;


    $('#setpwUserPassword').focus(function(){
        $("#pwd").html('');
    }).blur(function(){
        var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？《》]");
        var pwd = $("#setpwUserPassword").val();
        if(!pwd){
            $("#pwd").html('密码不能为空').css('color','red');
            flags=false;
        }else{
            if(pattern.test(pwd)){
                $("#pwd").html('不能使用特殊字符').css('color','red');
                flags = false;
            }else{
                if(pwd.length >= 6 && pwd.length <= 15){
                    flags = true;
                }else{
                    $("#pwd").html('密码长度6~15位之间').css('color','red');
                    flags = false;
                }
            }
        }

    });

    $("#setpwUserConfirmPassword").focus(function(){
        $("#pwds").html('');
    }).blur(function(){
        pwd = $("#setpwUserPassword").val();
        pwds = $("#setpwUserConfirmPassword").val();
        if(!pwds){
            $("#pwds").html('密码不能为空').css('color','red');
            flpwd=false;
        }else{
            if(pwd!=pwds){
                $("#pwds").html('两次密码不一致').css('color','red');
                flpwd=false;
            }else{
                flpwd=true;
            }
        }
    });

    $("form").submit(function(){
        if (!flags||!flpwd){
            return false;
        }else{
            return true;
        }
    });
</script>

<script>
    $("#signup1s").click(function(){
        if(confirm("确认重新设置登录密码")){
            $(".passwordSet").hide();
            $(".passwordReset").show();
        }

    })

</script>

